<!-- 申请详情 -->
<template>
  <el-button type="primary" @click="look">查看详情</el-button>
  <el-dialog v-model="dialogVisible" title="投递信息" width="1000">
    <div>
      <h1>个人信息</h1>
      <div style="display: flex">
        <div style="width: 20%"><el-avatar shape="square" :size="150" /></div>
        <div style="width: 70%">
          <div style="display: flex; justify-content: space-between">
            <div style="width: 40%">姓名</div>
            <div style="width: 40%">性别</div>
          </div>
          <div style="display: flex; justify-content: space-between">
            <div style="width: 40%">{{ bio.realName }}</div>
            <div style="width: 40%">{{ bio.gender }}</div>
          </div>
          <div
            style="
              display: flex;
              justify-content: space-between;
              margin-top: 20px;
            "
          >
            <div style="width: 40%">最高学历</div>
            <div style="width: 40%">工作经验</div>
          </div>
          <div style="display: flex; justify-content: space-between">
            <div style="width: 40%">{{ bio.qualification }}</div>
            <div style="width: 40%">{{ bio.workYears }}</div>
          </div>
          <div
            style="
              display: flex;
              justify-content: space-between;
              margin-top: 20px;
            "
          >
            <div style="width: 40%">联系电话</div>
            <div style="width: 40%">电子邮箱</div>
          </div>
          <div style="display: flex; justify-content: space-between">
            <div style="width: 40%">{{ bio.phone }}</div>
            <div style="width: 40%">{{ bio.email }}</div>
          </div>
          <div
            style="
              display: flex;
              justify-content: space-between;
              margin-top: 20px;
            "
          >
            <div style="width: 40%">期望薪资</div>
          </div>
          <div style="display: flex">
            <div style="width: 40%">
              {{ bio.intendSalaryMin }}-{{ bio.intendSalaryMax }}元
            </div>
          </div>
        </div>
      </div>
      <div>
        <h3>个人简介</h3>
        <div>{{ bio.personalProfile }}</div>
      </div>
      <div>
        <h1>申请信息</h1>
        <div style="display: flex; justify-content: space-between">
          <div style="width: 30%">
            <div>申请公司</div>
            <div>{{ info.companyName }}</div>
          </div>
          <div style="width: 30%">
            <div>申请职位</div>
            <div>{{ info.postName }}</div>
          </div>
          <div style="width: 30%">
            <div>申请时间</div>
            <div>{{ info.applyTime }}</div>
          </div>
        </div>
      </div>
      <div>
        <h1>工作经历</h1>
        <div
          v-for="(item, index) in bio.workExperience"
          :key="index"
          style="border-bottom: 1px solid #efefef; margin-bottom: 20px"
        >
          <div>
            <div style="display: flex; justify-content: space-between">
              <div>{{ item?.companyName }}</div>
              <div style="margin-right: 200px">
                {{ item?.startTime }}&emsp;到&emsp;{{ item?.endTime }}
              </div>
            </div>
            <div>{{ item?.workName }}</div>
            <div>{{ item?.content }}</div>
          </div>
        </div>
      </div>
    </div>
  </el-dialog>
</template>
<script setup>
import { reqGetResumeDetail } from "@/api/api";
const dialogVisible = ref(false);
const bio = ref({});
const { id, info } = defineProps({
  id: {
    type: Number,
    default: 0,
  },
  info: {
    type: Object,
    default: () => {},
  },
});

const look = () => {
  dialogVisible.value = true;
  getBiographical();
};

/**获取简历 */
const getBiographical = async () => {
  if (id) {
    const res = await reqGetResumeDetail(id);

    if (res.code == 200 && res.data) {
      res.data.workExperience = JSON.parse(res.data.workExperience);
      bio.value = res.data;
      console.log(bio.value);

      // console.log(form);
    }
  }
};
</script>
<style lang="scss" scoped></style>
